<!DOCTYPE html>
<html>
<head>
    {include file="../application/common/header.html" /}
</head>

<body>
    <div id="course_signup_recordtb">
        <form id="course_signup_recordForm" class="m10">
             学期：<select class="easyui-combobox" id="termId" name="termId" data-options="width:120,panelHeight:'auto',value:'', editable:false,textField:'学期名称',valueField:'ID',url:'/compent/Util/termList',onSelect:changeTerm"></select>
             年级：<select id="gradeId" name="gradeId" class="easyui-combobox" data-options="width:80,panelHeight:'auto',url:'/compent/Util/gradeNameList',onSelect:changeGrade"></select>
             班级：<select id="clazz" name="clazz" class="easyui-combobox" data-options="width:60,editable:false"></select>
             课程名称:<select id="courseId" name="courseId" class="easyui-combobox" data-options="width:150,url:'/kccsCourse/course_signup_record/courseList'"></select>
             <div class="mt10">
                学生姓名:<input id="studentName" name="studentName" class="easyui-textbox" style="width:100px;"/>
                <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="queryOk('course_signup_record')">查询</a>
                <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-clear'" onclick="resetForm('course_signup_record')">重置</a>
                <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-save'" onclick="zoutExcel()">导出为EXCEL</a>
            </div>
        </form>
    </div>
    <table id="course_signup_recorddg">
        <thead>
            <tr>
                <th data-options="field:'courseType',title:'课程分类'"></th>
                <th data-options="field:'courseNo',title:'课程编号'"></th>
                <th data-options="field:'courseName',title:'课程名称'"></th>
                <th data-options="field:'classTeacher',title:'辅导老师'"></th>
                <th data-options="field:'signClassDate',title:'上课时间'"></th>
                <th data-options="field:'gradeClass',title:'学生班级'"></th>
                <th data-options="field:'studentNum',title:'学生学号'"></th>
                <th data-options="field:'studentName',title:'学生姓名'"></th>
            </tr>
        </thead>
    </table>
    <script type="text/javascript">
        var url = "/kccsCourse/course_signup_record";
        $(function(){
            initDatagrid("course_signup_record", url);
        })
        function changeTerm(record){
            var gradeId = $('#gradeId').combobox('getValue');
            loadParam(record.ID,gradeId)
        }
        function changeGrade(record){
            var termId = $('#termId').combobox('getValue');
            loadParam(termId,record.value)
        }
        function loadParam(termId,gradeId) {
            if(!gradeId) return;
            var termName = $('#termId').combobox('getText');
            var termKey = termName.substr(termName,4);
            var grade = getGrade(termKey,gradeId);
            var url="/compent/Util/clazzList?grade="+grade;
            $('#clazz').combobox('setValue','');
            $('#clazz').combobox('reload',url);
        }
        function queryOk(cf){
            var termId = $('#termId').combobox('getValue');
            var termName = $('#termId').combobox('getText');
            var termKey = termName.substr(termName,4);
            var gradeId = $('#gradeId').combobox('getValue');
            var grade = getGrade(termKey,gradeId);
            var courseId = $('#courseId').combobox('getValue');
            var clazz = $('#clazz').combobox('getValue');
            var studentName = $('#studentName').textbox('getValue');
            $('#'+cf+'dg').datagrid('load',{termId:termId,grade:grade,clazz:clazz,courseId:courseId,studentName:studentName});
        }
        function zoutExcel(){
            var termId = $('#termId').combobox('getValue');
            var termName = $('#termId').combobox('getText');
            var termKey = termName.substr(termName,4);
            var gradeId = $('#gradeId').combobox('getValue');
            var grade = getGrade(termKey,gradeId);
            var courseId = $('#courseId').combobox('getValue');
            var clazz = $('#clazz').combobox('getValue');
            var studentName = $('#studentName').textbox('getValue');
            window.location.href = url+"/exportExcel.html?termId=" + termId+"&grade="+grade+"&clazz="+clazz+"&courseId="+courseId+"&studentName="+studentName;
        }
    </script>

</body>
</html>